#include "RegularGrammaticaTest.h"

RegularGrammaticaTest::RegularGrammaticaTest()
{
}

RegularGrammaticaTest::~RegularGrammaticaTest()
{
}

void RegularGrammaticaTest::testProgram()
{
	cout<<"Regular Grammatica Test"<<endl << "==================================="<<endl<<endl;
	
	list<string> helpSymbols;
	
	list<char> alphabet;
	
	list<ProductionRule<string> > rules;
	rules.push_back(ProductionRule <string>("A0", 'a', "A1"));
	rules.push_back(ProductionRule <string>("A0", 'b', "A4"));
	rules.push_back(ProductionRule <string>("A1", 'a', "A4"));
	rules.push_back(ProductionRule <string>("A1", 'b', "A2"));
	rules.push_back(ProductionRule <string>("A2", 'a', "A3"));
	rules.push_back(ProductionRule <string>("A2", 'b', "A4"));
	rules.push_back(ProductionRule <string>("A3", 'a', "A1"));
	rules.push_back(ProductionRule <string>("A3", 'b', "A2"));
	rules.push_back(ProductionRule <string>("A4", 'a', "A4"));
	rules.push_back(ProductionRule <string>("A4", 'b', "A4"));
	rules.push_back(ProductionRule <string>("A1", 'b'));
	rules.push_back(ProductionRule <string>("A2", 'a'));
	rules.push_back(ProductionRule <string>("A3", 'b'));
	
	RegGrammatica<string> *regGrammatica = new RegGrammatica<string>(helpSymbols, alphabet, rules, "A0");

	regGrammatica->printLanguage(10);
	regGrammatica->printProdRules();
	
	cout <<endl << "Einde Regular Grammatica test" <<endl;
}
